<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CU安全信息</title>
<script
	src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<script src="http://lib.sinaapp.com/js/bootstrap/v3.0.0/js/bootstrap.js"></script>
<link
	href="http://lib.sinaapp.com/js/bootstrap/v3.0.0/css/bootstrap-theme.min.css"
	rel="stylesheet" />
<link
	href="http://lib.sinaapp.com/js/bootstrap/v3.0.0/css/bootstrap.min.css"
	rel="stylesheet" />
<!-- 	<script src="//cdn.bootcss.com/angular.js/1.6.4/angular.min.js"></script> -->
</head>
<body>
	<input type="text" value="${sp_ids }">
	<input type="text" value="${name}">
	<div ng-app="security_report" ng-controller="securityReportController">
		<table class="table">
			<th>
				<!-- 				<td style="{{$even?'background-color: #f1f1f1':''}}">序号</td> -->
			<td style="even ?'background-color: #f1f1f1 ':''">目标IP</td>
			<td style="even ?'background-color: #f1f1f1 ':''">源IP</td>
			<td style="even ?'background-color: #f1f1f1 ':''">源端口</td>
			<td style="even ?'background-color: #f1f1f1 ':''">目标端口</td>
			<td style="even ?'background-color: #f1f1f1 ':''">机房ID</td>
			<td style="even ?'background-color: #f1f1f1 ':''">域名</td>
			<td style="even ?'background-color: #f1f1f1 ':''">代理类型</td>
			<td style="even ?'background-color: #f1f1f1 ':''">代理IP</td>
			<td style="even ?'background-color: #f1f1f1 ':''">代理端口</td>
			<td style="even ?'background-color: #f1f1f1 ':''">标题</td>
			<td style="even ?'background-color: #f1f1f1 ':''">内容</td>
			<td style="even ?'background-color: #f1f1f1 ':''">附件</td>
			<td style="even ?'background-color: #f1f1f1 ':''">采集时间</td>
			<td style="even ?'background-color: #f1f1f1 ':''">Url</td>
			<td style="even ?'background-color: #f1f1f1 ':''">录入时间</td>
			</th>
			<tr ng-repeat="report in reports">
				<td style="even ?'background-color: #f1f1f1 ':''">x$index +
					1}}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.destIp }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.srcIp }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.destPort }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.srcPort }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.houseId }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.domainName }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.proxyType }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.proxyIp }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.proxyPort }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.title }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.content }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.attachmentfile }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.gatherTime }}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{ report.url
					}}</td>
				<td style="even ?'background-color: #f1f1f1 ':''">{{
					report.find_time }}</td>
			</tr>
		</table>
		<!-- 			<ul class="pagination"> -->
		<!-- 			    <li><a href="#">&laquo;</a></li> -->
		<!-- 			    <li class="active"><a href="#">1</a></li> -->
		<!-- 			    <li class="disabled"><a href="#">2</a></li> -->
		<!-- 			    <li><a href="#">3</a></li> -->
		<!-- 			    <li><a href="#">4</a></li> -->
		<!-- 			    <li><a href="#">5</a></li> -->
		<!-- 			    <li><a href="#">&raquo;</a></li> -->
		<!-- 			</ul> -->
	</div>
	<script>
		var app = angular.module('security_report', []);
		app.controller('securityReportController', function($scope, $http,
				$timeout, $location) {
			var loop = function() {
				$timeout(function() {
					getReport();
					loop();
				}, 5000);
			};
			var getReport = function() {
				$http.post("security/result").then(function(response) {
					$scope.reports = response.data.data;
				});
			}
			getReport();
			loop();
		});
	</script>
</body>
</html>